home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Interfaces & Libraries / Interfaces / CIncludes / stdarg.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-08-05  |  699 b   |  34 lines  |  [TEXT/MPS ]

  1. /*
  2.     StdArg.h -- Variable arguments
  3.     
  4.     Copyright Apple Computer,Inc.    1987, 1990, 1994
  5.     All rights reserved.
  6.  
  7. */
  8.  
  9.  
  10. #ifndef __STDARG__
  11. #define __STDARG__
  12.  
  13. /*
  14.  * Get common declarations 
  15.  */
  16.  
  17. #include <NullDef.h>
  18. #include <SizeTDef.h>
  19. #include <VaListTDef.h>
  20.  
  21. #if !defined (__SC__) || defined (__CFM68K__)
  22.     /*    most normal compilers are long-word aligned…  */
  23.     #define va_start(ap, parmN) ap = (va_list)((unsigned int)&(parmN) + (((sizeof(parmN)+3)/4)*4))
  24. #else
  25.     /*    …but Symantec C is word aligned.  */
  26.     #define va_start(ap, parmN) ap = (va_list)((char*)&parmN + (((sizeof(parmN)+1)/2)*2))
  27. #endif
  28.  
  29. #define va_arg(ap, type) ((type *)(ap += sizeof (type)))[-1]
  30. #define va_end(ap)    /* do nothing */
  31.  
  32.  
  33. #endif
  34.